package com.study.mybatis.executor.statement;

import com.study.mybatis.executor.parameter.ParameterHandler;
import com.study.mybatis.session.ResultHandler;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;

/**
 * @author yuantongqin
 * 2021/7/31
 **/
public interface StatementHandler {


    Statement prepare(Connection connection, Integer transactionTimeout)
            throws SQLException;

    <E> List<E> query(Statement statement)
            throws SQLException;

    <E> List<E> query(Statement statement, ResultHandler resultHandler)
            throws SQLException;

    ParameterHandler getParameterHandler();

    void parameterize(Statement statement,Object parameter)
            throws SQLException;

}
